/*************************************************
 *FileName:      grade.js
 *Description:   魅力等级.js
 *Others:        陈灿
 *************************************************/
    /*
     * 启动
     */
    mui.init();
    mui('.mui-scroll-wrapper').scroll({
        indicators: false,      //是否显示滚动条 默认为true
        deceleration: 0.003,    //阻尼系数,系数越小滑动越灵敏 默认0.0006
        bounce: false           //是否启用回弹 默认true
    });
    /*
     * 变量初始化
     */
    var uid = localStorage.replace_uid;
    var token = localStorage.replace_token
    /*
     * 主程序
     */ 
    $(document).ready(function() 
    {
        //样式加载
        pagecss();
        //信息加载
//      getUsersInfo();
    });
    mui.plusReady(getUsersInfo())
    /**
     * getUsersInfo
     * 信息加载
     * @cc 
     * @DateTime 2018-01-08T06:19:16+0800
     * @param    int        
     * @return   void
     */
    function getUsersInfo(){
        $.ajax({
            type: "post",
            url: DOMAIN_NAME + "/index.php/api/user/getUserslevelInfo",
            dataType:'jsonp',
            data: { uid: uid },
            success: function(data) {
                if(data.error_code == 0){
                    $('.gradu_text').text(data.data.level);
                    $('.main .gradient-text1 i').html('LV'+data.data.level);
                    $('.main .gradient-text2 i').html('LV'+(data.data.level+1));
                    $('.main .articlecharm-em').css('width',data.data.exp/data.data.level_exp*100+'%');
                    $('.main .user-text-sis').html('我的魅力值：'+data.data.exp+'，离升级还差：'+data.data.level_up_exp);
                    $('.zjml-text').html(data.data.agree);
                }else if(data.error_code == 1001){
                    setTimeout(function(){
                        exitlogin();
                    },1000);
                }
            }
        });
    }